import axiosUtil from '@/config/axios/index'
let baseUrl = '/${serviceName}/${modelPath}/${changeTableName?uncap_first}'

const application = {
    // 列表
    get${changeTableName}ListByPage(option) {
        return axiosUtil.get(`${baseUrl}/get${changeTableName}ListByPage/${pageNum}/${pageSize}`, option.params, option.bak)
    },
    // 详情
    get${changeTableName}ById(option) {
        return axiosUtil.get(`${baseUrl}/get${changeTableName}ById/${optionId}`, option.params, option.bak)
    },
    // 新增
    insertAppInfo(option) {
        return axiosUtil.post(`${baseUrl}/insert${changeTableName}`, option.params, option.bak)
    },
    // 编辑
    update${changeTableName}ById(option) {
        return axiosUtil.put(`${baseUrl}/update${changeTableName}ById/${optionId}`, option.params, option.bak)
    },
    // 删除
    delete${changeTableName}ByIdList(option) {
        return axiosUtil.delete(`${baseUrl}/delete${changeTableName}ByIdList`, option.params, option.bak)
    }
}

let form = {
<#if modelColumn?exists>
    <#list modelColumn as model>
    // ${model.columnComment}
        <#if (model.columnType = 'int2' || model.columnType = 'int4' || model.columnType = 'int8' || model.columnType = 'float4' || model.columnType = 'float8' || model.columnType = 'numeric')>
    ${model.changeColumnName} : 1,
        <#else>
    ${model.changeColumnName} : '',
        </#if>
    </#list>
</#if>
}

<#if modelColumn?exists>
<#list modelColumn as model>
// ${model.columnComment}
         <#if (model.columnType = 'int2' || model.columnType = 'int4' || model.columnType = 'int8' || model.columnType = 'float4' || model.columnType = 'float8' || model.columnType = 'numeric')>
this.form.${model.changeColumnName} = 1
         <#else>
this.form.${model.changeColumnName} = ""
         </#if>
</#list>
</#if>

let formDataSourceRules = {
<#if modelColumn?exists>
<#list modelColumn as model>
    ${model.changeColumnName?uncap_first}: [
        {required: true, message: '请选择${model.columnComment}', trigger: 'change'},
    ],
</#list>
</#if>
}
